import bus from "@/bus";

let data = {
  status: 'pass',
  currentPage: 1,
  totalItem: 1,
  pageSize: window.$pageSize,
  form: {
    couponName: ''
  },
  columns: [{
      title: '优惠券名称',
      key: 'couponName'
    }, {
      title: '面额',
      key: 'denomination',
      minWidth: 200,
      render: (h, params) => {
        return h('div', params.row.denomination + '元')
      }
    }, {
      title: '张数',
      key: 'quantity',
      width:100,
    }, {
      title: '操作',
      align: 'left',
      minWidth: 180,
      render: (h, params) => {
        let editBtn = h('Button', {
          props:{
            size:'small',
            type:'primary'
          },
          class: 'mr',
          on: {
            click: () => {
              bus.$emit('onChange', {id: params.row.id, quantity: params.row.quantity})
            }
          }
        }, '改变张数')
        let delBtn = h('Button', {
          props:{
            size:'small',
            type: 'warning'
          },
          class: 'mr',
          on: {
            click: () => {
              bus.$emit('onDelete', {id: params.row.id, index: params.index})
            }
          }
        }, '删除')
        return h('div', [editBtn, delBtn])
      }
  }],
  data: []
}
export default data;